using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.ComponentModel;

namespace mdv.wssSchemaExplorer.WSS
{
    public class wssContentTypes
    {
        public wssContentTypes()
        {
        }
        public wssContentTypes(XmlNode node)
            : this()
        {
            if (node.HasChildNodes)
            {
                foreach (XmlNode xn in node)
                {
                    if (xn.Name == "ContentTypeRef")
                    {
                        if(null == _contentTypeRefs) _contentTypeRefs = new List<wssContentTypeRef>();
                        _contentTypeRefs.Add(new wssContentTypeRef(xn));
                    }
                    if (xn.Name == "ContentType")
                    {
                        if (null == _contentTypes) _contentTypes = new List<wssContentType>();
                        _contentTypes.Add(new wssContentType(xn));
                    }
                }
            }
        }
        #region Non-Designer Properties
        private List<wssContentType> _contentTypes;
        [Browsable(false)]
        public List<wssContentType> ContentTypes
        {
            get { return _contentTypes; }
        }
        private List<wssContentTypeRef> _contentTypeRefs;
        [Browsable(false)]
        public List<wssContentTypeRef> ContentTypeRefs
        {
            get { return _contentTypeRefs; }
        }
        #endregion
        public override string ToString()
        {
            return "ContentTypes";
        }
    }
}